﻿@{
    ViewData["Title"] = "DI 服务端使用";
}
<h1>@ViewData["Title"]</h1>

<input id="td1" type="text"/>
<button id="btn1">依赖注入后台发送</button>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script>
 
$("#btn1").click(function(){
    
        let psdata =
        {
           td:$("#td1").val() 
        };
         $.ajax({
            url: '/Home/setp1',
            type: 'POST',
            async: false,
            contentType: 'application/json',
            data: JSON.stringify(psdata),
            success: function (data) {
                //alert(data);
                }
             
        });
         
})
</script>